﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Project_Udrinkwater.PagesAdmin
{
    public partial class revenue_expenditure : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PanelMonth.Visible = false;
                PanelYear.Visible = false;
            }
        }

        protected void ASPxCheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (chboxlist.SelectedIndex == 0)
            {
                PanelDay.Visible = true;
                PanelMonth.Visible = false;
                PanelYear.Visible = false;
            }
            if (chboxlist.SelectedIndex == 1)
            {
                PanelDay.Visible = false;
                PanelMonth.Visible = true;
                PanelYear.Visible = false;
            }
            if (chboxlist.SelectedIndex == 2)
            {
                PanelDay.Visible = false;
                PanelMonth.Visible = false;
                PanelYear.Visible = true;
            }
            
        }

        protected void ASPxPivotGridExporterDay_CustomExportCell(object sender, DevExpress.Web.ASPxPivotGrid.Export.WebCustomExportCellEventArgs e)
        {
            e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            e.Appearance.Font = new Font("Angsana New", 16, FontStyle.Regular);
        }

        protected void bt_ExportExcel_Click(object sender, EventArgs e)
        {
            if (chboxlist.SelectedIndex==0)
            {
                ASPxPivotGridExporterDay.ExportXlsToResponse("PrivotGrid", true);
            }
            if (chboxlist.SelectedIndex == 1)
            {
                ASPxPivotGridExporterMonth.ExportXlsToResponse("PrivotGrid", true);
            }
            if (chboxlist.SelectedIndex == 2)
            {
                ASPxPivotGridExporterYear.ExportXlsToResponse("PrivotGrid", true);
            }
            
        }

        protected void bt_ExportPDF_Click(object sender, EventArgs e)
        {
            if (chboxlist.SelectedIndex == 0)
            {
                ASPxPivotGridExporterDay.ExportPdfToResponse("PrivotGrid", true);
            }
            if (chboxlist.SelectedIndex == 1)
            {
                ASPxPivotGridExporterMonth.ExportPdfToResponse("PrivotGrid", true);
            }
            if (chboxlist.SelectedIndex == 2)
            {
                ASPxPivotGridExporterYear.ExportPdfToResponse("PrivotGrid", true);
            }
        }
       
           

    }
}